chrome.runtime.onInstalled.addListener(() => {
    console.log("Extension Installed");
  });
  
  chrome.action.onClicked.addListener((tab) => {
    chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => {
      let activeTab = tabs[0];
      let url = new URL(activeTab.url);
      let hierarchy = url.pathname.split('/').filter(Boolean);
      console.log('层级标签:', hierarchy);
      // You can also send this information to a popup or content script
    });
  });
  